<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/amazeui.min.css" />
		<link rel="stylesheet" href="css/admin.css" />
	</head>

	<body>
		<div class="admin-content-body">
			<div class="am-cf am-padding am-padding-bottom-0">
				<div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">公司审核</strong><small></small></div>
			</div>

			<hr>
        </div>
        <form  id="form">

            <table>
                <tr>
                    <td>公司ID </td>
                    <td><input type="text" id="companyId" name="companyId" value=""/></td>
                </tr>
                <tr>
                    <td>公司名称</td>
                    <td><input type="text" id="companyName" name="companyName" value=""/></td>
                </tr>
                <tr>
                    <td>公司简介 </td>
                    <td><input type="text" id="companyShort" name="companyShort" value=""/></td>
                </tr>
                <tr>
                    <td>公司行业</td>
                    <td><input type="text" id="companyHangye" name="companyHangye" value=""/></td>
                </tr>
                <tr>
                    <td>公司规模 </td>
                    <td><input type="text" id="companyGuimo" name="companyGuimo" value=""/></td>
                </tr>
                <tr>
                    <td>公司logo </td>
                    <td><img src=""  alt="公司LOGO" style="vertical-align: top" width="120" height="170" id="logo"></td>
                </tr>
                <tr>
                    <td>证件照 </td>
                    <td><img src=""  alt="证件照" style="vertical-align: top" width="120" height="170" id="document"></td>
                </tr>
                <tr>
                    <td>营业执照 </td>
                    <td><img src=""  alt="营业执照" style="vertical-align: top" width="120" height="170" id="corporation"></td>
                </tr>
                <tr>
                    <td>发展阶段 </td>
                    <td><input type="text" id="develop" name="develop" value=""/></td>
                </tr>
                <tr>
                    <td>审核状态 </td>
                    <td>
                        <select id="auditState" name="auditState">
                        <option value="">全部</option>
                    </select>
                    </td>
                </tr>
                <tr>
                    <td>回复信息</td>
                    <td><textarea placeholder="恭喜您已通过审核" id="texts" name="texts"></textarea><input type="button" value="发送" id="email"/></td>

                </tr>
            </table>
            <div class="am-form-group">
                <div class="am-u-sm-9 am-u-sm-push-3">
                    <input type="button" id="addRole" class="am-btn am-btn-success" value="审核" type="button">
                </div>
            </div>
        </form>
        <script type="text/javascript" src="js/jquery-1.12.4.js"></script>
    <script>
        $(function () {
            var url=location.href;
            var companyId=url.substring(url.indexOf("?")+1);
            function first() {
                $.get("/selectAllAuditstate.json",function (data) {

                    for (var i=0;i<data.length;i++){
                        var sort=data[i];
                        var str="<option value='"+sort.stateid+"'>"+sort.statename+
                            "</option>";
                        $("#auditState").append(str);
                    }
                },"json");
            };
            first();
            function shows() {
                $.get("/selectById.json",companyId,function (data) {
                    $("#companyId").val(data.companyId);
                    $("#companyName").val(data.companyName);
                    $("#companyShort").val(data.companyShort);
                    $("#companyHangye").val(data.companyHangye);
                    $("#companyGuimo").val(data.companyGuimo);
                    $("#logo").attr("src",data.logo);
                    $("#document").attr("src",data.document);//val(data.document);
                    $("#corporation").attr("src",data.corporation);
                    $("#develop").val(data.develop);
                    $("#auditState").val(data.auditState);

                },"json");
            };
            shows();
            $("#addRole").click(function () {
                $.post("/update.json",$("#form").serialize(),function (data) {
                    if (data==1){
                        location.href="/message.html";
                    } else{
                        location.href="/user.html";
                    }
                },"json");
            });
            $("#email").click(function () {
                $.post("/email.json",$("#form").serialize(),function (data) {

                },"json");
            });

        })
        
    </script>
	</body>
</html>